//
//  UIBarButtonItem+Extension.swift
//  SniaWeiBo
//
//  Created by lcc on 16/5/11.
//  Copyright © 2016年 lcc. All rights reserved.
//

import UIKit

extension UIBarButtonItem {

    convenience init(title: String , fontSize: CGFloat , target: AnyObject? ,action: Selector) {
        //问题
        self.init()
        
        let button = UIButton()
        //点击事件
        button.addTarget(target, action: action, forControlEvents: .TouchUpInside)
        
        button.setTitle(title, forState: .Normal)
        button.titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        button.setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
        button.setTitleColor(UIColor.orangeColor(), forState: .Highlighted)
        button.sizeToFit()
        
        customView = button
        
        
    }
}
